<?php
/**
 * Created by PhpStorm.
 * User: 17464
 * Date: 2019/12/27
 * Time: 16:49
 */

namespace App\Http\Requests\Setting;

use App\Http\Requests\ApiRequest;

class OssSettingRequest extends ApiRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * 传递参数 验证规则
     *
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'key' => 'required',
            'AccessKeyID' => 'required',
            'AccessKeySecret'=>'required',
            'BucketName'=>'required',
            'Endpoint'=>'required',
            'Domain'=>'required',
            'TokenExpireTime'=>'required'
        ];
    }

    /**
     * 获取已定义验证规则的错误消息。
     *
     * @return array
     */
    public function messages()
    {
        return [
            'key.required'=>'请填写key值',
            'AccessKeyID.required'=>'请填写AccessKeyID参数',
            'AccessKeySecret.required'=>'请填写AccessKeySecret参数',
            'BucketName.required'=>'请填写BucketName参数',
            'Endpoint.required'=>'请填写Endpoint参数',
            'Domain.required'=>'请填写Domain参数',
            'TokenExpireTime.required'=>'请填写TokenExpireTime参数',
        ];
    }
}
